package com.ets.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ets.dao.QuestionDao;
import com.ets.entity.Question;

@Service
public class QuestionService {
	@Resource
	private QuestionDao dao;
	//Get all questions.
	public List<Question> getAllQuestions(){
		return dao.getAll();
	}
	
	//Add or update question.
	public void save(Question question){
		dao.update(question);
	}
	
	//Get question by id.
	public Question getQuestion(int id){
		return dao.getQuestion(id);
	}
	
	//Delete question.
	public void deteleQuestion(int id){
		dao.delete(id);
	}
}
